3.3.75 \(\int (c \sec (e+f x))^n (a+a \sec (e+f x))^m (A+B \sec (e+f x)) \, dx\) [275]

Optimal. Leaf size=197 \[ -\frac {B F_1\left (n;\frac {1}{2},-\frac {1}{2}-m;1+n;\sec (e+f x),-\sec (e+f x)\right ) (c \sec (e+f x))^n (1+\sec (e+f x))^{-\frac {1}{2}-m} (a+a \sec (e+f x))^m \tan (e+f x)}{f n \sqrt {1-\sec (e+f x)}}-\frac {(A-B) F_1\left (n;\frac {1}{2},\frac {1}{2}-m;1+n;\sec (e+f x),-\sec (e+f x)\right ) (c \sec (e+f x))^n (1+\sec (e+f x))^{-\frac {1}{2}-m} (a+a \sec (e+f x))^m \tan (e+f x)}{f n \sqrt {1-\sec (e+f x)}} \]

[Out]

-B*AppellF1(n,-1/2-m,1/2,1+n,-sec(f*x+e),sec(f*x+e))*(c*sec(f*x+e))^n*(1+sec(f*x+e))^(-1/2-m)*(a+a*sec(f*x+e))
^m*tan(f*x+e)/f/n/(1-sec(f*x+e))^(1/2)-(A-B)*AppellF1(n,1/2-m,1/2,1+n,-sec(f*x+e),sec(f*x+e))*(c*sec(f*x+e))^n
*(1+sec(f*x+e))^(-1/2-m)*(a+a*sec(f*x+e))^m*tan(f*x+e)/f/n/(1-sec(f*x+e))^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.25, antiderivative size = 197, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {4108, 3913, 3912, 138} \begin {gather*} -\frac {(A-B) \tan (e+f x) (\sec (e+f x)+1)^{-m-\frac {1}{2}} (a \sec (e+f x)+a)^m (c \sec (e+f x))^n F_1\left (n;\frac {1}{2},\frac {1}{2}-m;n+1;\sec (e+f x),-\sec (e+f x)\right )}{f n \sqrt {1-\sec (e+f x)}}-\frac {B \tan (e+f x) (\sec (e+f x)+1)^{-m-\frac {1}{2}} (a \sec (e+f x)+a)^m (c \sec (e+f x))^n F_1\left (n;\frac {1}{2},-m-\frac {1}{2};n+1;\sec (e+f x),-\sec (e+f x)\right )}{f n \sqrt {1-\sec (e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c*Sec[e + f*x])^n*(a + a*Sec[e + f*x])^m*(A + B*Sec[e + f*x]),x]

[Out]

-((B*AppellF1[n, 1/2, -1/2 - m, 1 + n, Sec[e + f*x], -Sec[e + f*x]]*(c*Sec[e + f*x])^n*(1 + Sec[e + f*x])^(-1/
2 - m)*(a + a*Sec[e + f*x])^m*Tan[e + f*x])/(f*n*Sqrt[1 - Sec[e + f*x]])) - ((A - B)*AppellF1[n, 1/2, 1/2 - m,
 1 + n, Sec[e + f*x], -Sec[e + f*x]]*(c*Sec[e + f*x])^n*(1 + Sec[e + f*x])^(-1/2 - m)*(a + a*Sec[e + f*x])^m*T
an[e + f*x])/(f*n*Sqrt[1 - Sec[e + f*x]])

Rule 138

Int[((b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_)*((e_) + (f_.)*(x_))^(p_), x_Symbol] :> Simp[c^n*e^p*((b*x)^(m +
 1)/(b*(m + 1)))*AppellF1[m + 1, -n, -p, m + 2, (-d)*(x/c), (-f)*(x/e)], x] /; FreeQ[{b, c, d, e, f, m, n, p},
 x] &&  !IntegerQ[m] &&  !IntegerQ[n] && GtQ[c, 0] && (IntegerQ[p] || GtQ[e, 0])

Rule 3912

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Dist[a^2*d
*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x]])), Subst[Int[(d*x)^(n - 1)*((a + b*x)^(m -
 1/2)/Sqrt[a - b*x]), x], x, Csc[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] &&  !In
tegerQ[m] && GtQ[a, 0]

Rule 3913

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_), x_Symbol] :> Dist[a^Int
Part[m]*((a + b*Csc[e + f*x])^FracPart[m]/(1 + (b/a)*Csc[e + f*x])^FracPart[m]), Int[(1 + (b/a)*Csc[e + f*x])^
m*(d*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] &&  !IntegerQ[m] &&  !GtQ
[a, 0]

Rule 4108

Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*
(B_.) + (A_)), x_Symbol] :> Dist[(A*b - a*B)/b, Int[(a + b*Csc[e + f*x])^m*(d*Csc[e + f*x])^n, x], x] + Dist[B
/b, Int[(a + b*Csc[e + f*x])^(m + 1)*(d*Csc[e + f*x])^n, x], x] /; FreeQ[{a, b, d, e, f, A, B, m}, x] && NeQ[A
*b - a*B, 0] && EqQ[a^2 - b^2, 0]

Rubi steps

\begin {align*} \int (c \sec (e+f x))^n (a+a \sec (e+f x))^m (A+B \sec (e+f x)) \, dx &=(A-B) \int (c \sec (e+f x))^n (a+a \sec (e+f x))^m \, dx+\frac {B \int (c \sec (e+f x))^n (a+a \sec (e+f x))^{1+m} \, dx}{a}\\ &=\left ((A-B) (1+\sec (e+f x))^{-m} (a+a \sec (e+f x))^m\right ) \int (c \sec (e+f x))^n (1+\sec (e+f x))^m \, dx+\left (B (1+\sec (e+f x))^{-m} (a+a \sec (e+f x))^m\right ) \int (c \sec (e+f x))^n (1+\sec (e+f x))^{1+m} \, dx\\ &=-\frac {\left ((A-B) c (1+\sec (e+f x))^{-\frac {1}{2}-m} (a+a \sec (e+f x))^m \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(c x)^{-1+n} (1+x)^{-\frac {1}{2}+m}}{\sqrt {1-x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {1-\sec (e+f x)}}-\frac {\left (B c (1+\sec (e+f x))^{-\frac {1}{2}-m} (a+a \sec (e+f x))^m \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(c x)^{-1+n} (1+x)^{\frac {1}{2}+m}}{\sqrt {1-x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {1-\sec (e+f x)}}\\ &=-\frac {B F_1\left (n;\frac {1}{2},-\frac {1}{2}-m;1+n;\sec (e+f x),-\sec (e+f x)\right ) (c \sec (e+f x))^n (1+\sec (e+f x))^{-\frac {1}{2}-m} (a+a \sec (e+f x))^m \tan (e+f x)}{f n \sqrt {1-\sec (e+f x)}}-\frac {(A-B) F_1\left (n;\frac {1}{2},\frac {1}{2}-m;1+n;\sec (e+f x),-\sec (e+f x)\right ) (c \sec (e+f x))^n (1+\sec (e+f x))^{-\frac {1}{2}-m} (a+a \sec (e+f x))^m \tan (e+f x)}{f n \sqrt {1-\sec (e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(4897\) vs. \(2(197)=394\).
time = 21.84, size = 4897, normalized size = 24.86 \begin {gather*} \text {Result too large to show} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[(c*Sec[e + f*x])^n*(a + a*Sec[e + f*x])^m*(A + B*Sec[e + f*x]),x]

[Out]

(2^(1 + m)*(Sec[(e + f*x)/2]^2)^n*Sec[e + f*x]^(-1 - n)*(c*Sec[e + f*x])^n*(Cos[(e + f*x)/2]^2*Sec[e + f*x])^(
m + n)*(a*(1 + Sec[e + f*x]))^m*(A + B*Sec[e + f*x])*(A*Sec[e + f*x]^n*(1 + Sec[e + f*x])^m + B*Sec[e + f*x]^(
1 + n)*(1 + Sec[e + f*x])^m)*Tan[(e + f*x)/2]*((-3*A*AppellF1[1/2, m + n, 1 - n, 3/2, Tan[(e + f*x)/2]^2, -Tan
[(e + f*x)/2]^2]*Cos[e + f*x])/(3*AppellF1[1/2, m + n, 1 - n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] +
2*((-1 + n)*AppellF1[3/2, m + n, 2 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + (m + n)*AppellF1[3/2,
1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2) - (B*AppellF1[1/2, 1 + m
+ n, -n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])/(AppellF1[1/2, 1 + m + n, -n, 3/2, Tan[(e + f*x)/2]^2,
 -Tan[(e + f*x)/2]^2] + (2*(n*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] +
(1 + m + n)*AppellF1[3/2, 2 + m + n, -n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2)/3)
))/(f*(B + A*Cos[e + f*x])*(1 + Sec[e + f*x])^m*(-1 + Tan[(e + f*x)/2]^2)*(-((2^(1 + m)*(Sec[(e + f*x)/2]^2)^(
1 + n)*(Cos[(e + f*x)/2]^2*Sec[e + f*x])^(m + n)*Tan[(e + f*x)/2]^2*((-3*A*AppellF1[1/2, m + n, 1 - n, 3/2, Ta
n[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Cos[e + f*x])/(3*AppellF1[1/2, m + n, 1 - n, 3/2, Tan[(e + f*x)/2]^2, -
Tan[(e + f*x)/2]^2] + 2*((-1 + n)*AppellF1[3/2, m + n, 2 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] +
(m + n)*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2) - (
B*AppellF1[1/2, 1 + m + n, -n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])/(AppellF1[1/2, 1 + m + n, -n, 3/
2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + (2*(n*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -
Tan[(e + f*x)/2]^2] + (1 + m + n)*AppellF1[3/2, 2 + m + n, -n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*
Tan[(e + f*x)/2]^2)/3)))/(-1 + Tan[(e + f*x)/2]^2)^2) + (2^m*(Sec[(e + f*x)/2]^2)^(1 + n)*(Cos[(e + f*x)/2]^2*
Sec[e + f*x])^(m + n)*((-3*A*AppellF1[1/2, m + n, 1 - n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Cos[e +
 f*x])/(3*AppellF1[1/2, m + n, 1 - n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 2*((-1 + n)*AppellF1[3/2
, m + n, 2 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + (m + n)*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, T
an[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2) - (B*AppellF1[1/2, 1 + m + n, -n, 3/2, Tan[(e + f
*x)/2]^2, -Tan[(e + f*x)/2]^2])/(AppellF1[1/2, 1 + m + n, -n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] +
(2*(n*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + (1 + m + n)*AppellF1[3/2
, 2 + m + n, -n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2)/3)))/(-1 + Tan[(e + f*x)/2
]^2) + (2^(1 + m)*n*(Sec[(e + f*x)/2]^2)^n*(Cos[(e + f*x)/2]^2*Sec[e + f*x])^(m + n)*Tan[(e + f*x)/2]^2*((-3*A
*AppellF1[1/2, m + n, 1 - n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Cos[e + f*x])/(3*AppellF1[1/2, m +
n, 1 - n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + 2*((-1 + n)*AppellF1[3/2, m + n, 2 - n, 5/2, Tan[(e
+ f*x)/2]^2, -Tan[(e + f*x)/2]^2] + (m + n)*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e +
 f*x)/2]^2])*Tan[(e + f*x)/2]^2) - (B*AppellF1[1/2, 1 + m + n, -n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^
2])/(AppellF1[1/2, 1 + m + n, -n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + (2*(n*AppellF1[3/2, 1 + m +
n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2] + (1 + m + n)*AppellF1[3/2, 2 + m + n, -n, 5/2, Tan[(e
 + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2)/3)))/(-1 + Tan[(e + f*x)/2]^2) + (2^(1 + m)*(Sec[(e +
f*x)/2]^2)^n*(Cos[(e + f*x)/2]^2*Sec[e + f*x])^(m + n)*Tan[(e + f*x)/2]*((3*A*AppellF1[1/2, m + n, 1 - n, 3/2,
 Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sin[e + f*x])/(3*AppellF1[1/2, m + n, 1 - n, 3/2, Tan[(e + f*x)/2]^2
, -Tan[(e + f*x)/2]^2] + 2*((-1 + n)*AppellF1[3/2, m + n, 2 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]
 + (m + n)*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2)
- (3*A*Cos[e + f*x]*(-1/3*((1 - n)*AppellF1[3/2, m + n, 2 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*S
ec[(e + f*x)/2]^2*Tan[(e + f*x)/2]) + ((m + n)*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(
e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[(e + f*x)/2])/3))/(3*AppellF1[1/2, m + n, 1 - n, 3/2, Tan[(e + f*x)/2]^2
, -Tan[(e + f*x)/2]^2] + 2*((-1 + n)*AppellF1[3/2, m + n, 2 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]
 + (m + n)*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2])*Tan[(e + f*x)/2]^2)
- (B*((n*AppellF1[3/2, 1 + m + n, 1 - n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[(e + f*x)/2]^2*Tan[
(e + f*x)/2])/3 + ((1 + m + n)*AppellF1[3/2, 2 + m + n, -n, 5/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^2]*Sec[
(e + f*x)/2]^2*Tan[(e + f*x)/2])/3))/(AppellF1[1/2, 1 + m + n, -n, 3/2, Tan[(e + f*x)/2]^2, -Tan[(e + f*x)/2]^
2] + (2*(n*AppellF1[3/2, 1 + m + n, 1 - n, 5/2,...

________________________________________________________________________________________

Maple [F]
time = 0.41, size = 0, normalized size = 0.00 \[\int \left (c \sec \left (f x +e \right )\right )^{n} \left (a +a \sec \left (f x +e \right )\right )^{m} \left (A +B \sec \left (f x +e \right )\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*sec(f*x+e))^n*(a+a*sec(f*x+e))^m*(A+B*sec(f*x+e)),x)

[Out]

int((c*sec(f*x+e))^n*(a+a*sec(f*x+e))^m*(A+B*sec(f*x+e)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*sec(f*x+e))^n*(a+a*sec(f*x+e))^m*(A+B*sec(f*x+e)),x, algorithm="maxima")

[Out]

integrate((B*sec(f*x + e) + A)*(a*sec(f*x + e) + a)^m*(c*sec(f*x + e))^n, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*sec(f*x+e))^n*(a+a*sec(f*x+e))^m*(A+B*sec(f*x+e)),x, algorithm="fricas")

[Out]

integral((B*sec(f*x + e) + A)*(a*sec(f*x + e) + a)^m*(c*sec(f*x + e))^n, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \left (\sec {\left (e + f x \right )} + 1\right )\right )^{m} \left (c \sec {\left (e + f x \right )}\right )^{n} \left (A + B \sec {\left (e + f x \right )}\right )\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*sec(f*x+e))**n*(a+a*sec(f*x+e))**m*(A+B*sec(f*x+e)),x)

[Out]

Integral((a*(sec(e + f*x) + 1))**m*(c*sec(e + f*x))**n*(A + B*sec(e + f*x)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c*sec(f*x+e))^n*(a+a*sec(f*x+e))^m*(A+B*sec(f*x+e)),x, algorithm="giac")

[Out]

integrate((B*sec(f*x + e) + A)*(a*sec(f*x + e) + a)^m*(c*sec(f*x + e))^n, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \left (A+\frac {B}{\cos \left (e+f\,x\right )}\right )\,{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^m\,{\left (\frac {c}{\cos \left (e+f\,x\right )}\right )}^n \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B/cos(e + f*x))*(a + a/cos(e + f*x))^m*(c/cos(e + f*x))^n,x)

[Out]

int((A + B/cos(e + f*x))*(a + a/cos(e + f*x))^m*(c/cos(e + f*x))^n, x)

________________________________________________________________________________________